package com.tg.service.eventbus2;

import com.tg.service.base.CreateBeanApp;
import com.tg.service.eventbus2.entity.Event;
import com.tg.service.utils.ContextUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;

@SpringBootApplication
//@ComponentScan({"com.tg.service.eventbus2"})
public class SpringStarter {

    public static void main(String[] args) {
        ConfigurableApplicationContext ctx = SpringApplication.run(SpringStarter.class, args);
        ContextUtil.setApplicationContext(ctx);

        ComponentBus componentBus = (ComponentBus) ctx.getBean("LoginEventBusFactoryBean");
        componentBus.post(new Event());
    }

    private static void invoke() {

    }
}
